# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-marisa-trie
pkgver=1.2.0
pkgrel=0
pkgdesc="Static memory-efficient and fast Trie-like structures for Python"
url="https://github.com/kmike/marisa-trie"
# loongarch64: blocked by py3-readme_renderer
arch="all !loongarch64"
license="MIT"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	"
checkdepends="
	py3-hypothesis
	py3-pytest
	py3-readme_renderer
	"
source="https://pypi.python.org/packages/source/m/marisa_trie/marisa_trie-$pkgver.tar.gz"
builddir="$srcdir/marisa_trie-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	case "$CARCH" in
	arm*)
		.testenv/bin/python3 -m pytest \
			--ignore tests/test_trie.py
		# https://github.com/pytries/marisa-trie/issues/96
		;;
	*)
		.testenv/bin/python3 -m pytest
		;;
	esac
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
f2b7556e4ef324ed5075271fa53692f3357bbde8bb8d550a974d369e7c9a2ef37f647cda9666ef94bbd874fdeec756043ca30bf872523d462b1b65de1546bd83  marisa_trie-1.2.0.tar.gz
"
